package com.dayuanit.dy16.atm.boatm.dto;

public class ResponseDTO {
    public static final int success_code = 1000;
    public static final int error_code = 9999;
    public static final int unLogin_code = 5000;

    private int code;
    private String message;
    private Object data;

    private ResponseDTO(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static ResponseDTO success(Object data) {
        return new ResponseDTO(success_code, null, data);
    }

    public static ResponseDTO success() {
        return new ResponseDTO(success_code, null, null);
    }

    public static ResponseDTO fail(String message) {
        return new ResponseDTO(error_code, message, null);
    }

    public static ResponseDTO unLogin() {
        return new ResponseDTO(unLogin_code, "请重新登录", null);
    }

    public int getCode() {
        return code;
    }

    public Object getData() {
        return data;
    }

    public String getMessage() {
        return message;
    }
}
